Fix revision bug. #287 & #339