Finished bug fixing