Some bug fixes: