Some minor fixes and codestyling