Merge pull request #1425 from jlipps/master

add tests for #1413, also fix jsonwp misinterpretation
add more logging and error handling to authorize
fix #1409?