More bug fixes. Prolly should've tested first.