Fixed logic by adding ALE condition.

Also need to add address end condition to error checking.