Fixed small SQL bug and added inital WOL code