PR 1: Conventions, imports, try with resource, casts fixes, serial IDs

Some fixes I made to the code.