Added exception, utils and fixes