Added frame capping and statistics printing.