Fixed rewrite rules and added option to enble WP compat