Report catched exception in test
Add ternary ifelse test
Remove dead code
Allow returning of array passed into the function as argument