Fixed issue #4, and isue #8 partially

For issue #4, I added if statements to check if variables were set.
For issue #8, I fixed the log table records by detecting a soft delete.