Maintenance, small changes, bugfixes and cleanups