Fixed a couple of fatal bugs.