API improved and bug fixes.