Some bug fixing....