Fixing cast error (& turning on compiler warnings for future)