fix bug causing median() to break if only one tick recorded