Revert "Added 2 bugfix pullrequests"

This reverts commit 1cd7b148f5e2045214ebe8501282f3a1b899ef38.