Follow up to fix #34 and some changes to work with latest CoSeMe