Clean up some compiler warnings and deprecated functions