Fixed bugs reported by Mike