--- a/ext_system/sys_calls.c
+++ b/ext_system/sys_calls.c
@@ -3,10 +3,11 @@
 #include <stdio.h>
 #if (defined(WIN32) || defined(_WIN32) || defined(__WIN32))
 #include <io.h>
+#include <direct.h>
 #else
 #include <unistd.h>
-#include <errno.h>
 #endif
+#include <errno.h>
 
 // THIS IS DONE IN ORDER TO UNIFORM ERROR NUMBERS BETWEEN OS
 #define INT_EEXIST 1
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -79,7 +79,7 @@
   find_package(MPI REQUIRED)
   target_link_libraries(negf PUBLIC MpiFx::MpiFx MPI::MPI_Fortran)
 endif()
-target_link_libraries(negf PRIVATE ${BLAS_LIBRARIES} ${LAPACK_LIBRARIES})
+target_link_libraries(negf PRIVATE BLAS::BLAS LAPACK::LAPACK)
 
 target_include_directories(negf PUBLIC
   $<BUILD_INTERFACE:${BUILD_MOD_DIR}>
--- a/src/api/CMakeLists.txt
+++ b/src/api/CMakeLists.txt
@@ -1,13 +1,15 @@
 set(negf-interface-headers)
 set(all-header-deps libnegf_api.f90 bind_fortran)
 
+find_package(Python3 REQUIRED COMPONENTS Interpreter)
+
 add_custom_target(negf-c-binding ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/libnegf.h)
 set(c-header-binding-deps binding/map_negf_c.txt binding/begin_c.txt binding/end_c.txt)
 add_custom_command(
     OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/libnegf.h
     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${all-header-deps} ${CMAKE_CURRENT_SOURCE_DIR}/${c-header-binding-deps}
     COMMENT "Generating C header"
-    COMMAND ./bind_fortran -f c -m binding/map_negf_c.txt -b binding/begin_c.txt -n -t -e binding/end_c.txt libnegf_api.f90 > ${CMAKE_CURRENT_BINARY_DIR}/libnegf.h
+    COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/bind_fortran -f c -m binding/map_negf_c.txt -b binding/begin_c.txt -n -t -e binding/end_c.txt libnegf_api.f90 > ${CMAKE_CURRENT_BINARY_DIR}/libnegf.h
     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
 )
 list(APPEND negf-interface-headers ${CMAKE_CURRENT_BINARY_DIR}/libnegf.h)
@@ -18,7 +20,7 @@
     OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/libnegf.hpp
     DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/${all-header-deps} ${CMAKE_CURRENT_SOURCE_DIR}/${cpp-header-binding-deps}
     COMMENT "Generating C++ header"
-    COMMAND ./bind_fortran -f c++ -m binding/map_negf_cpp_wrapped.txt -b binding/begin_cpp_wrapped.txt -t -e binding/end_cpp_wrapped.txt libnegf_api.f90 > ${CMAKE_CURRENT_BINARY_DIR}/libnegf.hpp
+    COMMAND ${Python3_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/bind_fortran -f c++ -m binding/map_negf_cpp_wrapped.txt -b binding/begin_cpp_wrapped.txt -t -e binding/end_cpp_wrapped.txt libnegf_api.f90 > ${CMAKE_CURRENT_BINARY_DIR}/libnegf.hpp
     WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
 )
 list(APPEND negf-interface-headers ${CMAKE_CURRENT_BINARY_DIR}/libnegf.hpp)
