Bug fixes in branch