Add some bug fixing