Cleaned up some ugly mess