Syntax fixes and minification without missing `afterSelect`