Some more cleanup, trying to get this to pass the unit tests...