Fix for mkprwtp function