Fixed some minor bugs with some minor hacks.