fixed some weird left-over bugs