diff --git a/dev/pps_gen.c b/dev/pps_gen.c
index 8865333844eb6e089ae8351bd5f8116210cb2e28..8cdd77992f476fb7686d151f69188a5f08a2356f 100644
--- a/dev/pps_gen.c
+++ b/dev/pps_gen.c
@@ -67,7 +67,7 @@ int pps_gen_set_time(uint64_t seconds, uint32_t nanoseconds)
  	ppsg_write(ADJ_UTCHI, (uint32_t ) (seconds >> 32) & 0xff);
 	ppsg_write(ADJ_NSEC, (int32_t) ((int64_t) nanoseconds * 1000LL / (int64_t)REF_CLOCK_PERIOD_PS));
 
-  ppsg_write(CR, ppsg_read(CR) | PPSG_CR_CNT_SET);
+  ppsg_write(CR, (ppsg_read(CR) & 0xfffffffb) | PPSG_CR_CNT_SET);
 	return 0;
 }
 
diff --git a/shell/cmd_time.c b/shell/cmd_time.c
index 8b79d1a39cf877d9a9a7e2afc4f4e5e85a673fc1..9ed5b7bf05906803b0e65e5dda39226afa594807 100644
--- a/shell/cmd_time.c
+++ b/shell/cmd_time.c
@@ -25,7 +25,7 @@ int cmd_time(const char *args[])
 	if(args[2] && !strcasecmp(args[0], "set")) {
 		if(wrc_ptp_get_mode() != WRC_MODE_SLAVE)
 		{
-			pps_gen_set_time(atoi(args[1]), atoi(args[2]) / 8);
+			pps_gen_set_time((uint64_t)atoi(args[1]), atoi(args[2]) / 8);
 			return 0;
 		} else
 			return -EBUSY;