Fixed bug with running self test