Fixes for portable build