Gates and locks