Bug with incorrect count fixed