some of Joey's bugs fixed