Bug fixes...

The bugs were found by me...