Fixed bug with profile lookup and periods.
Fixed bug with entity lookup from DB