Minor Bugfixes and removed erroneous compiler warnings

This time with the proper formatting!