Fix for issue #1

- Fixed safe redirections when unsafe redirections is set to true
- Added tests