Did some bug fixing.