Correct minor bugs and add sendNotification if motion detected when away