Raise exception when bind fails

This could resolve issues of #139, #137 and #114.