minor Bug Fixes

some minor bug Fixes I found.