Fixed a rare crash, small changes for beta 6.