Fixed bug in code.