Fix most byte-compiler warnings, make most vars custom