Fixes AI motion alarms not properly clearing

Motions alarms will now properly clear for AI and silicons (fixes  #6496).
Some minor code cleaning while i was at it.