Fixed support for the <bin dir> optional argument

Fixed support for the <bin dir> optional argument, rather than hard coding the build directory. Default behavior is unchanged.