Prevent possible crash when rendering a marker

Prevents a possible crash when rendering a marker:
http://openeye.openmods.info/crashes/4e94260c23958a0c6e5d3ba81c2bd8f3

Also a mini cleanup.