Minor bug fixes, mostly involving stupid z-indexing