fixes #6: Added input validation to join and select

Also added a new exception to deal with bad inputs to intrinsic functions