Various bugfixes and updates to naming conventions