Fixed fairly major bug in smart alarm