Fixed the replacement patterns