Bug squashing, cleanup