Implement some fixes and improvements