Cleaned up code to avoid compiler warnings (mostly by adding #allow's).