Improves error checks in constructor and adds tests for URL helper