Added param default; removed unreachable code; expanded tests.