Adding rules to package res and fix some details