Some cleanup, fixes