Fix hardcoding and PEM utility