Better log error checks
Add security to test module