Make the build scripts remove dangling build directories
Fix chicken compilation
Replace `which` with `type -P`