Minor style tweaks.
Style cleanup, added bounds checking before locations update.