Mutiple bugfixes

Hi,

this is my first commit with the bugfixes i already did on the project.

Greetings
Jimmy