Fixed bug in running median code.