Separate shape types into categories, fix shape problems (fix #152)