Fixed "processed" flag hack; Minor code optimization.