Fixed a number of bltant bugs.