Minor improvements, including fixes, performance and safety

good catch! i already to cherrypick this and the \org pattern in 46d12be30df3e580477802ea4e60775beb01849b for a test release.