Fixing issues 1405 and 867 (duplicate)

Signed-off-by: Jonas Groeger <jonas.groeger@googlemail.com>

This fixes the issues 1405 and 867 (duplicate of 1405) for the CI 3 milestone, It seemed that the original contributor https://github.com/madhazelnut was not longer active and the changes he made were good, just not style guide compliant.

So I made them compliant. Check out the result. I'd be happy to see this merged. Then we just have 8 more issues for CI 3 :)

#fixes 1405
#fixes 867