Bu fixes and code cleaning