Minor changes and code cleaning