Cleanups and bugfixes. Now use kernel style