vast performance increases with @CompileStatic
small fixes