Fixed minor bugs on patient mapping