Modified to work with PMR2 0.6.