Bug fix in function for creating binaries