Misc changes and improvement