Further ace count bug fix.  Tidy up and tests to complete