Fixes #5604: Automatically check ordering and $() syntax