Added extractInt method to help with parsing messages.