some fixes and improves on errors